package com.dindang.service.impl;

import java.util.List;

import com.dindang.bean.Goods;

import com.dindang.dao.GoodsDao;
import com.dindang.dao.impl.GoodsDaoImpl;
import com.dindang.service.GoodsService;

public class GoodsServiceImpl implements GoodsService {
	
	private GoodsDao goodsDao = (GoodsDao) new GoodsDaoImpl();

	@Override
	public Object getAllGoods(int pageNum, int pageSize) {
		List<Goods> goodsList = goodsDao.selectAllGoods(pageNum, pageSize);
		int rows = goodsDao.selectAllGoodsNum();
		com.shop.bean.Page<Goods> page = new com.shop.bean.Page(goodsList,pageNum, pageSize,rows);
		return page;
	}

	@Override
	public int deleteGoods(int goodsId) {
		// TODO Auto-generated method stub
		return goodsDao.deleteGoodsById(goodsId);
	}

}
